import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Login2 from '@/views/login2.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home1',
      name: 'home1',
      component: () => import('../views/UserRegist.vue'),
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/main.vue'),
      children: [// 子路由//实现画中画
        {
          path: '/main/userMain',
          name: 'userMain',
          component: () => import('../views/user/userMain.vue'),
        },
        {
          path: '/main/roleMain',
          name: 'roleMain',
          component: () => import('../views/role/roleMain.vue'),
        },
        {
          path: '/main/deptMain',
          name: 'deptMain',
          component: () => import('../views/dept/deptMain.vue'),
        }
        // {
        //   path: '/main/about',
        //   name: 'about',
        //   component: () => import('../views/AboutView.vue'),
        // },
      ],
    },
    // {
    //   path: '/login',
    //   name: 'login',
    //   component: () => import('../views/login.vue'),
    // },
    {
      path: '/',
      name: 'login2',
      component: Login2,
    },
  ],
})

export default router
